/*    */ package com.zimbra.cs.client.soap;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.DomUtil;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.cs.client.LmcDocument;
/*    */ import org.dom4j.DocumentHelper;
/*    */ import org.dom4j.Element;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class LmcSaveDocumentRequest
/*    */   extends LmcSendMsgRequest
/*    */ {
/*    */   private LmcDocument mDoc;
/*    */   
/* 33 */   public void setDocument(LmcDocument doc) { this.mDoc = doc; }
/*    */   
/* 35 */   public LmcDocument getDocument() { return this.mDoc; }
/*    */   
/*    */   protected Element getRequestXML() {
/* 38 */     Element request = DocumentHelper.createElement(MailConstants.SAVE_DOCUMENT_REQUEST);
/* 39 */     Element doc = DomUtil.add(request, "doc", "");
/* 40 */     LmcSoapRequest.addAttrNotNull(doc, "name", this.mDoc.getName());
/* 41 */     LmcSoapRequest.addAttrNotNull(doc, "ct", this.mDoc.getContentType());
/* 42 */     LmcSoapRequest.addAttrNotNull(doc, "l", this.mDoc.getFolder());
/* 43 */     Element upload = DomUtil.add(doc, "upload", "");
/* 44 */     LmcSoapRequest.addAttrNotNull(upload, "id", this.mDoc.getAttachmentId());
/* 45 */     return request;
/*    */   }
/*    */   
/*    */   protected LmcSoapResponse parseResponseXML(Element responseXML) throws ServiceException
/*    */   {
/* 50 */     LmcSaveDocumentResponse response = new LmcSaveDocumentResponse();
/* 51 */     LmcDocument doc = parseDocument(DomUtil.get(responseXML, "doc"));
/* 52 */     response.setDocument(doc);
/* 53 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/client/soap/LmcSaveDocumentRequest.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */